set(SOURCES
    ${CMAKE_SOURCE_DIR}/include/core/constants.h
    ${CMAKE_SOURCE_DIR}/include/core/coresettings.h
    ${CMAKE_SOURCE_DIR}/include/core/track.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audiobuffer.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audioconverter.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audioengine.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audioformat.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audioinput.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audiooutput.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/enginecontroller.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/inputplugin.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/audioloader.h
    ${CMAKE_SOURCE_DIR}/include/core/engine/outputplugin.h
    ${CMAKE_SOURCE_DIR}/include/core/library/libraryinfo.h
    ${CMAKE_SOURCE_DIR}/include/core/library/musiclibrary.h
    ${CMAKE_SOURCE_DIR}/include/core/library/tracksort.h
    ${CMAKE_SOURCE_DIR}/include/core/network/networkaccessmanager.h
    ${CMAKE_SOURCE_DIR}/include/core/player/playbackqueue.h
    ${CMAKE_SOURCE_DIR}/include/core/player/playercontroller.h
    ${CMAKE_SOURCE_DIR}/include/core/player/playerdefs.h
    ${CMAKE_SOURCE_DIR}/include/core/playlist/playlist.h
    ${CMAKE_SOURCE_DIR}/include/core/playlist/playlisthandler.h
    ${CMAKE_SOURCE_DIR}/include/core/playlist/playlistparser.h
    ${CMAKE_SOURCE_DIR}/include/core/plugins/coreplugin.h
    ${CMAKE_SOURCE_DIR}/include/core/plugins/coreplugincontext.h
    ${CMAKE_SOURCE_DIR}/include/core/plugins/plugin.h
    ${CMAKE_SOURCE_DIR}/include/core/scripting/expression.h
    ${CMAKE_SOURCE_DIR}/include/core/scripting/scriptparser.h
    ${CMAKE_SOURCE_DIR}/include/core/scripting/scriptregistry.h
    ${CMAKE_SOURCE_DIR}/include/core/scripting/scriptscanner.h
    ${CMAKE_SOURCE_DIR}/include/core/scripting/scriptvalue.h
    application.cpp
    application.h
    corepaths.cpp
    corepaths.h
    internalcoresettings.cpp
    internalcoresettings.h
    track.cpp
    translationloader.cpp
    translationloader.h
    database/database.cpp
    database/database.h
    database/dbschema.cpp
    database/dbschema.h
    database/generaldatabase.cpp
    database/generaldatabase.h
    database/librarydatabase.cpp
    database/librarydatabase.h
    database/playlistdatabase.cpp
    database/playlistdatabase.h
    database/settingsdatabase.cpp
    database/settingsdatabase.h
    database/trackdatabase.cpp
    database/trackdatabase.h
    engine/archiveinput.cpp
    engine/archiveinput.h
    engine/audiobuffer.cpp
    engine/audioclock.cpp
    engine/audioclock.h
    engine/audioconverter.cpp
    engine/audioengine.cpp
    engine/audioinput.cpp
    engine/audioformat.cpp
    engine/audioplaybackengine.cpp
    engine/audioplaybackengine.h
    engine/audiorenderer.cpp
    engine/audiorenderer.h
    engine/enginehandler.cpp
    engine/enginehandler.h
    engine/audioloader.cpp
    engine/tagdefs.h
    engine/taglibparser.cpp
    engine/taglibparser.h
    engine/ffmpeg/ffmpegcodec.cpp
    engine/ffmpeg/ffmpegcodec.h
    engine/ffmpeg/ffmpeginput.cpp
    engine/ffmpeg/ffmpeginput.h
    engine/ffmpeg/ffmpegframe.cpp
    engine/ffmpeg/ffmpegframe.h
    engine/ffmpeg/ffmpegresampler.cpp
    engine/ffmpeg/ffmpegresampler.h
    engine/ffmpeg/ffmpegstream.cpp
    engine/ffmpeg/ffmpegstream.h
    engine/ffmpeg/ffmpegutils.cpp
    engine/ffmpeg/ffmpegutils.h
    library/librarymanager.cpp
    library/librarymanager.h
    library/libraryscanner.cpp
    library/libraryscanner.h
    library/librarysort.h
    library/librarythreadhandler.cpp
    library/librarythreadhandler.h
    library/libraryutils.cpp
    library/libraryutils.h
    library/librarywatcher.cpp
    library/librarywatcher.h
    library/sortingregistry.cpp
    library/sortingregistry.h
    library/trackdatabasemanager.cpp
    library/trackdatabasemanager.h
    library/tracksort.cpp
    library/unifiedmusiclibrary.cpp
    library/unifiedmusiclibrary.h
    network/networkaccessmanager.cpp
    player/playbackqueue.cpp
    player/playercontroller.cpp
    playlist/playlist.cpp
    playlist/playlisthandler.cpp
    playlist/playlistparser.cpp
    playlist/playlistloader.cpp
    playlist/playlistloader.h
    playlist/parsers/cueparser.cpp
    playlist/parsers/cueparser.h
    playlist/parsers/m3uparser.cpp
    playlist/parsers/m3uparser.h
    plugins/plugin.cpp
    plugins/plugininfo.cpp
    plugins/plugininfo.h
    plugins/pluginmanager.cpp
    plugins/pluginmanager.h
    scripting/functions/controlfuncs.cpp
    scripting/functions/controlfuncs.h
    scripting/functions/mathfuncs.cpp
    scripting/functions/mathfuncs.h
    scripting/functions/stringfuncs.cpp
    scripting/functions/stringfuncs.h
    scripting/functions/timefuncs.cpp
    scripting/functions/timefuncs.h
    scripting/functions/tracklistfuncs.cpp
    scripting/functions/tracklistfuncs.h
    scripting/scriptcache.cpp
    scripting/scriptcache.h
    scripting/scriptparser.cpp
    scripting/scriptregistry.cpp
    scripting/scriptscanner.cpp
)

create_fooyin_library(
    fooyin_core
    ADD_PRIVATE_TARGET
    EXPORT_NAME Core
    SOURCES ${SOURCES}
)

target_link_libraries(
    fooyin_core
    PRIVATE fooyin_version fooyin_config
    PUBLIC Qt6::Core
           Qt6::Widgets
           Qt6::Sql
           Qt6::Concurrent
           Qt6::Network
           Taglib::Taglib
           Fooyin::Utils
           ${FFMPEG_LIBRARIES}
)

target_include_directories(
    fooyin_core PRIVATE ${FFMPEG_INCLUDE_DIRS}
)
